package cn.bj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bj.beans.Yxfw_travel;
import cn.bj.dao.Yxfw_travelMapper;

@Service
public class TravelService {
	@Autowired
	Yxfw_travelMapper yxfw_travelMapper;

	// 查询所有
	public List<Yxfw_travel> getAllTravels() {
		return yxfw_travelMapper.selectByExample(null);
	}

	// 插入
	public int insrtTravel(Yxfw_travel travel) {
		return yxfw_travelMapper.insert(travel);
	}

	// 删除
	public int deleteTravel(Integer id) {
		return yxfw_travelMapper.deleteByPrimaryKey(id);
	}

	// 查询单个
	public Yxfw_travel selectById(Integer id) {
		return yxfw_travelMapper.selectByPrimaryKey(id);
	}

	// 修改
	public int updateTravvel(Yxfw_travel travel) {
		return yxfw_travelMapper.updateByPrimaryKey(travel);
	}

}
